xen/arm: fix affected memory range by dcache clean functions
authorStefano Stabellini <sstabellini@kernel.org>
Fri, 3 Mar 2017 01:15:26 +0000 (17:15 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 7 Mar 2017 19:23:43 +0000 (11:23 -0800)
commit2e68fda962226d4de916d5ceab9d9d6037d94d45
treed1004e0d631c88a0583b8e06f599eb7539162943
parentf85fc979a6859541dc1bf583817ca5cce9287e1e
xen/arm: fix affected memory range by dcache clean functions

clean_dcache_va_range and clean_and_invalidate_dcache_va_range don't
calculate the range correctly when "end" is not cacheline aligned. As a
result, the last cacheline is not skipped. Fix the issue by aligning the
start address to the cacheline size.

In addition, make the code simpler and faster in
invalidate_dcache_va_range, by removing the module operation and using
bitmasks instead. Also remove the size adjustments in
invalidate_dcache_va_range, because the size variable is not used later
on.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
xen/include/asm-arm/page.h